home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / entrt101.zip / EIDEMO.PAS next >
Pascal/Delphi Source File  |  1993-04-22  |  4KB  |  133 lines

  1.  
  2.  {$A+,B-,D-,E-,F-,I+,N-,O-,R+,S-,V+}
  3.  {$M 2048, 0,0}
  4.  
  5. program DemoEnterItUnit;
  6. uses
  7.   Qwriter,
  8.   EnterIt;
  9.  
  10. var                (* Test variables to get.                                *)
  11.   ShortVar  : shortint;   
  12.   ByteVar   : byte;
  13.   IntVar    : integer;
  14.   WordVar   : word;
  15.   LongVar   : longint;
  16.   RealVar   : real;
  17.   StringVar : VidString;
  18.  
  19. BEGIN              (* If Color video then clear the screen to deep blue.    *)
  20.   if ColorMode then          
  21.     ClearScr($17)
  22.  
  23.                    (* Else, clear the screen to black.                      *)
  24.   else
  25.     ClearScr($07);
  26.  
  27.                    (* Hide the cursor.                                      *)
  28.   HideCursor(On);
  29.  
  30.                    (* Set ErrorMessage position and color.                  *)
  31.   InitErrorMess(26, 12, RevAttr);
  32.  
  33.                    (* Prompt the User for a number.                         *)
  34.   Qwrite(' Enter a shortint between -10 and 35 :', 1,2, NormAttr);
  35.  
  36.   ShortVar := EnterShort(-10,35, 3, 40,2, RevAttr);
  37.  
  38.  
  39.   Qwrite('ShortInt = ' + Int2Str(ShortVar, 5), 2,4, NormAttr);
  40.  
  41.                    (* Wait until the <ENTER> is pressed.                    *)
  42.   Pause(EnterKey);
  43.  
  44.   Qwrite('                                      ', 1,2, NormAttr);
  45.   Qwrite('                ', 2,4, NormAttr);
  46.  
  47.                    (* Prompt the User for a number.                         *)
  48.   Qwrite(' Enter a byte between  25 and 75 :    ', 1,2, NormAttr);
  49.  
  50.   ByteVar := EnterByte(25,75, 3, 40,2, RevAttr);
  51.  
  52.   Qwrite('Byte = ' + Int2Str(ByteVar, 5), 2,4, NormAttr);
  53.  
  54.                    (* Wait until the <ENTER> is pressed.                    *)
  55.   Pause(EnterKey);
  56.  
  57.   Qwrite('                                      ', 1,2, NormAttr);
  58.   Qwrite('             ', 2,4, NormAttr);
  59.  
  60.                    (* Prompt the User for a number.                         *)
  61.   Qwrite(' Enter an integer between  -500 and +500 : ', 1,2, NormAttr);
  62.  
  63.   IntVar := EnterInt(-500,500, 4, 45,2, RevAttr);
  64.  
  65.   Qwrite('Integer = ' + Int2Str(IntVar, 5), 2,4, NormAttr);
  66.  
  67.                    (* Wait until the <ENTER> is pressed.                    *)
  68.   Pause(EnterKey);
  69.  
  70.   Qwrite('                                                ',
  71.          1,2, NormAttr);
  72.   Qwrite('                ', 2,4, NormAttr);
  73.  
  74.                    (* Prompt the User for a number.                         *)
  75.   Qwrite(' Enter a word between  2,500 and 3,500 : ', 1,2, NormAttr);
  76.  
  77.   WordVar := EnterWord(2500,3500, 5, 42,2, RevAttr);
  78.  
  79.   Qwrite('Integer = ' + Comma(Int2Str(WordVar, 5), 5), 2,4, NormAttr);
  80.  
  81.                    (* Wait until the <ENTER> is pressed.                    *)
  82.   Pause(EnterKey);
  83.  
  84.   Qwrite('                                         ', 1,2, NormAttr);
  85.   Qwrite('                ', 2,4, NormAttr);
  86.  
  87.                    (* Prompt the User for a number.                         *)
  88.   Qwrite(' Enter a longint between  -1,000 and +2,000 : ', 1,2, NormAttr);
  89.  
  90.   LongVar := EnterLong(-1000,2000, 5, 47,2, RevAttr);
  91.  
  92.   Qwrite('Longint = ' + Comma(Int2Str(LongVar, 5), 5), 2,4, NormAttr);
  93.  
  94.                    (* Wait until the <ENTER> is pressed.                    *)
  95.   Pause(EnterKey);
  96.  
  97.   Qwrite('                                                    ',
  98.          1,2, NormAttr);
  99.   Qwrite('                ', 2,4, NormAttr);
  100.  
  101.                    (* Prompt the User for a number.                         *)
  102.   Qwrite(' Enter a Real between  -25.50 and +50.20 : ', 1,2, NormAttr);
  103.  
  104.   RealVar := EnterReal(-25.50, 50.20, 2, 7, 47,2, RevAttr);
  105.  
  106.   Qwrite('Real = ' + Real2Str(RealVar, 7, 2), 2,4, NormAttr);
  107.  
  108.                    (* Wait until the <ENTER> is pressed.                    *)
  109.   Pause(EnterKey);
  110.  
  111.   Qwrite('                                                    ',
  112.          1,2, NormAttr);
  113.   Qwrite('                ', 2,4, NormAttr);
  114.  
  115.                    (* Prompt the User for a string.                         *)
  116.   Qwrite(' Enter a single 15 char string : ', 1,2, NormAttr);
  117.  
  118.   StringVar := EnterString(15, 45,2, RevAttr);
  119.  
  120.   Qwrite('Your string was: ' + StringVar, 2,4, NormAttr);
  121.  
  122.                    (* Wait until the <ENTER> is pressed.                    *)
  123.   Pause(EnterKey);
  124.  
  125.                    (* Display the cursor again.                             *)
  126.   HideCursor(Off);
  127.  
  128.                    (* Clear the screen to black.                            *)
  129.   ClearScr($07)
  130. END.
  131.  
  132.  
  133.